Image processing apparatus and method, and storage medium

ABSTRACT

The present invention efficiently compresses image data, and stores and manages the compressed data. Image data is compressed in tile unit having predetermined pixels and data packing is performed. The compressed data is compared with compressed data of a preceding packet. If these compressed data are different, the packet data is stored in a memory, and an entry address of the compressed data is stored in a packet table. Meanwhile, if the compressed data is equal to the compressed data of the preceding packet, the compressed data is not stored, but an entry address of the compressed data of the preceding packet is stored in a record of interest in the packet table, and a flag indicative of repetition of the preceding address is set in the packet of interest.

FIELD OF THE INVENTION

[0001] The present invention relates to an image processing apparatus and method as well as a storage medium for compressing and storing image data.

BACKGROUND OF THE INVENTION

[0002] Conventionally, for managing image data divided in packet unit and stored in a memory, a header is provided to the packet for writing information regarding the length of the packet, and the packet data is arranged in a given order. Therefore, as long as reading/writing is performed in the given order, the header information is correctly read/written by virtue of the header information. Moreover, for randomly accessing the packet, a packet table having addresses of stored packets is used.

[0003] Generally speaking, in a case of image data printed by a printer, a portion not including characters is blank, thus having no data. Such blank portion often takes up a large proportion of the page. When image data for a page is divided into packets and managed, many packets include pixels for the blank portion. As a result, a large number of packets having exactly the same data take up a large proportion of the memory.

SUMMARY OF THE INVENTION

[0004] The present invention has been proposed in consideration of the conventional problem, and has as its object to provide an image processing apparatus and method as well as a storage medium, which enable effective compression of image data, storage and management of the data.

[0005] In order to solve the above problem, for instance, the image processing apparatus according to the present invention has the following configuration.

[0006] More specifically, the present invention provides an image processing apparatus for compressing and storing image data, comprising: division means for dividing the image data into a pixel block, which is a group of a predetermined number of pixels; generation means for compressing the data in the pixel block unit and sequentially generating packet data; packet table storage means for storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division by the division means; and storage control means for storing packet data of interest generated by the generation means and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest.

[0007] Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0009]FIG. 1 is a view showing a packet table according to a first embodiment of the present invention;

[0010]FIG. 2 is a view showing a packet format;

[0011]FIG. 3 is a view showing, as an example, image data for one page, divided in tile unit of 32×32 pixels;

[0012]FIG. 4 is a flowchart explaining packing processing;

[0013]FIG. 5 is a block diagram showing an apparatus according to the first embodiment;

[0014]FIG. 6 is a block diagram showing a system according to a second embodiment of the present invention; and

[0015]FIG. 7 is a block diagram showing a packet generating apparatus 506.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] Preferred embodiments of the present invention will now be described in detail in accordance with the accompanying drawings.

[0017] [First Embodiment]

[0018]FIG. 1 shows a relationship between packet data and a packet table according to a first embodiment of the present invention.

[0019] In FIG. 1, reference numeral 10 denotes a packet table indicating a starting address 101 of each packet in the memory. Reference numeral 102 denotes a repeat flag, which is set ON if data is the same as the data of the preceding packet, but is set OFF if data is different from the preceding packet. Reference numeral 11 denotes a packet data area set in the memory, which is schematically shown in the drawing.

[0020]FIG. 2 shows a packet format. Each packet is packed in the form shown in the drawing. A packet is constructed with image data corresponding to a tile having 32×=pixels, and a header indicative of information regarding the image data. The header includes a packet ID indicative of a packet serial number, a compression flag indicative of whether or not the image data is compressed, and a data length indicative of the image data volume. Note in FIG. 2, since one byte is secured for the packet ID, the number of packets becomes up to 256. In order to handle a larger size of image data, a larger number of bits or bytes may be assigned to the packet ID.

[0021]FIG. 3 shows image data for one page, divided in tile unit of 32×=pixels. One page of image is divided in tile unit as shown in the drawing. The tile is constructed with a group of 32×=pixels. A header is added to the tile of image data, thereby forming a packet. The tile unit does not have to be 32 ×32 pixels, but may be, e.g., 64×64 pixels. Moreover, the tile unit does not need to be a square, but may be a rectangle or the like. When image data is compressed, instead of compressing data for one page altogether, image data in each packet is independently compressed.

[0022] Assume herein that image data for one page, stored in a memory, is compressed and packed in unit of 32×=pixels by software, and the packed image data is stored in another memory area. Further, a packet table is generated in another memory area.

[0023]FIG. 4 is a flowchart showing packing processing.

[0024] In step S1, one tile data (32×=pixels) is obtained from image data subjected to packing, and compression is performed. JPEG or other compression methods may be used for this compression. Then, a header (data volume is also set in the header) is added to the compressed data and packing is performed.

[0025] Next, in step S2, it is determined whether or not the compressed data is equal to the preceding packet data. In a case of the first tile data, i.e., Packet ID=1, determination in step S2 is made NO because there is no preceding data, then the control proceeds to step S3.

[0026] In step S3, the generated packet data is written in the memory. In step S4, the head address of the memory area where the packet data is written is set in the packet table entry having a corresponding packet ID. At this stage, the repeat flag is set OFF.

[0027] In step S6, it is determined whether or not the processing is completed to the end of the page. If NO, the control returns to step S1.

[0028] When tile data is packed and stored one by one as described above, there is a case the tile data is equal to the preceding compressed data. This case arises, for instance, when the tile data of interest is in a blank area, e.g., a space between lines. In this case, the determination in step S2 is made YES, and the control proceeds to step S5.

[0029] In step S5, the packet data generated for the tile data of interest is not written in the memory, but the head address of the packet, to which comparison is made, is set in a corresponding address of the packet table entry, and the repeat flag is set ON.

[0030] When the foregoing processing is repeatedly performed, in a case there are more than two successive tile data having at least the same compressed data, the packet data of the succeeding tile data is not written in the memory. Instead, the address of the packet table for the packet data previously determined as the same is set in the address of the packet table entry, and the repeat flag is set ON.

[0031] Note that FIG. 1 shows a case where the compressed data of the fourth tile data (Packet ID=4) is equal to the compressed data of the preceding (the third) tile data (i.e., the address stored in the packet table points the same position).

[0032] As described above, according to the first embodiment, although the data volume corresponding to one record is necessary in the packet table for packing one tile data, in the case where image data includes the same compressed data successively, packet data for the succeeding tile data is not necessary. Therefore, the first embodiment is extremely effective in the case of processing, for instance, texts or the like because the data includes a blank area, i.e., space between lines.

[0033] As an apparatus performing the above-described processing, the configuration shown in FIG. 5 is proposed.

[0034] In FIG. 5, reference numeral 1 denotes a CPU for controlling the entire apparatus; 2, ROM for storing a boot program or BIOS or the like. Reference numeral 3 denotes RAM, which serves as a work area of the CPU 1, and to which an operating system (OS) and the aforementioned processing program are loaded. Reference numeral 4 denotes a hard disk for storing an OS, files for the aforementioned processing program, and compressed data files (packet table file, packet data). Reference numeral 5 denotes a communication interface for connecting with a network (e.g., intranet, Internet); 6, a keyboard; and 7, a mouse. Reference numeral 8 denotes a display control unit, which controls display operation and includes a display controller and video memory. Reference numeral 9 denotes a display apparatus which performs displaying based on a video signal (image stored in the video memory) from the display control unit 8, and 10 denotes an image scanner.

[0035] In the foregoing configuration, when a power of the apparatus is turned on, the OS is loaded from the hard disk 4 to the RAM 3, and an application program for performing the above-described processing is loaded to the RAM 3. When a user designates an image input on the application program, an image is inputted from the communication interface 5 or image scanner 10, then the processing shown in FIG. 4 is executed, and the image data is stored as a file in the hard disk 4.

[0036] The packet table and packet data may be stored as separate files as shown in FIG. 5. However, this makes the file management cumbersome, and may raise a problem of storing the packet table and packet data in different memory. Therefore, these data may be stored as one file. In this case, the file may be constructed with two parts: the first part for the packet table portion and the latter part for the packet data portion. Note that the packet table portion should include an area for storing a byte number indicative of a number the packet data portion starts in the file. However, this area is not necessary if data (e.g., N×M tile image) corresponding to the size of the packet table is stored in the packet table portion to help deriving the head address of the packet data portion. By virtue of managing the packet table and packet data as one file as described above, these data are always handled together, and file management is facilitated.

[0037] [Second Embodiment]

[0038] Next, the second embodiment of the present invention is described. The second embodiment is an example of applying the present invention to a multi-function apparatus.

[0039] Referring to FIG. 6, reference numeral 61 denotes a system controller for controlling the entire apparatus; 62, a scanner controller; 63, a printer controller, all of which are connected by a ring bus 600.

[0040] The system controller 61 comprises: a CPU 501, a memory controller 502, memory 503 (RAM or the like), and a DMA controller (DMAC) 504 for performing DMA transfer via the ring bus 600, all of which are connected to the system bus 505. The printer controller 63 receives image data edited by the system controller 61, or raw data from the scanner controller 62, and have a printer unit 510 perform printing. The scanner controller 62 comprises: buffer memory 507, packet generating apparatus 506, and an input port 508 for inputting data from a scanner unit 509. The scanner controller 62 controls the scanner unit 509, packs image data obtained by reading an original document, and outputs the packed image data to the system controller 61 or printer controller 63.

[0041] Data flow in the above-described configuration is explained below.

[0042] When the scanner controller 62 receives a command to read an original document from the system controller 61, the scanner controller 62 drives the scanner unit 509 to read the original document.

[0043] Then, the scanner controller 62 compresses the image data, read by the scanner unit 509, in tile unit of 32×=pixels, generates packet data as well as a packet table in the buffer memory 507, and DMA-transfers the result to the system controller 61.

[0044]FIG. 7 is a block diagram mainly showing a packet generating apparatus 506. Reference numeral 601 denotes a compression apparatus for compressing image data, inputted from the image input port 508, in tile unit of 32×=pixels; 603, a header generating apparatus for generating a packet header; 602, a packet merging apparatus for merging the header with the compressed image data and generating a packet; and 604, a buffer controller for storing a packet in the buffer memory, or comparing a packet transmitted from the packet merging apparatus 603 with packet data in the buffer memory.

[0045] First, image data is transmitted from the image input port 508 in tile unit of 32×=pixels. The compression apparatus 601 compresses the image data, transmits the compressed data to the packet merging apparatus 602, and informs the header generating apparatus 603 of the data volume of the compressed data. The header generating apparatus 603 performs serial numbering of packet ID, and stores the data length in the image data bit length. The packet merging apparatus 602 merges the image data from the compression apparatus 601 with the header data from the header generating apparatus 603, thereby generating a packet. The packet is transmitted to the buffer controller 604. The buffer controller includes a buffer flag indicative of whether or not packet data is currently stored in the buffer memory. If the buffer flag is ON, it indicates that a preceding packet exists in the buffer memory 507 and that the volume of the packet is equal to or smaller than a predetermined volume. Assume herein that the capacity of the buffer memory 507 is 256 bytes. A packet having a volume larger than 256 bytes is not stored in the buffer memory 507, and the buffer flag is set OFF. Herein, the capacity of the buffer memory 507 and a threshold value for turning on the buffer flag are set in a value smaller than the packet image data before compression. In this manner, a packet having a volume larger than a predetermined volume is not stored in the buffer memory and excluded from comparison. When packets having the same data continuously exist, the image data is often a white space such as a white background. In the case of compressing such data, an excellent compression rate is expected. In other words, a packet having a large volume is not likely to have the same data as a preceding packet even if comparison is performed. Adopting this idea, a packet having a large volume is excluded from data comparison.

[0046] When the buffer controller 604 receives packet data from the packet merging apparatus 602, if the volume of the packet is equal to or smaller than 256 bytes and the buffer flag is ON, the buffer controller 604 compares the received packet data with the packet data in the buffer memory 507, sequentially from the top. When data match is found for the entire volume of the packet, the image data is extracted from the packet and the header only is sent to the DMAC 504, with the repeat flag of the packet header ON. Meanwhile, when data disagreement is found in the middle of the comparison, starting therefrom, the packet data is newly stored in the buffer memory 507. When the entire packet is stored, the buffer controller 604 reads the packet from the head of the buffer memory 507, and sends the packet to the DMAC 504. Meanwhile, when the buffer controller 604 receives packet data from the packet merging apparatus 602, if the volume of the packet is larger than 256 bytes, the buffer controller 604 sets the buffer flag OFF and directly transmits the packet to the DMAC 504 without storing the packet in the buffer memory 507. The DMAC 504 writes the received packet in the memory. The DMAC 504 comprises a packet address register for indicating an address where packet data is stored, and a packet table address register for indicating an address where a packet table is stored. This packet table does not need to be stored in the memory, but may be stored in the register. When the repeat flag of a received packet is OFF, the packet data is written in an address designated by a packet address register. In addition, the address designated by the packet address register is written in an address designated by a packet table address register. The volume corresponding to the packet is added to the packet address register, and 4 bytes corresponding to one entry of the packet table are added to the packet table address register. Upon completion of this processing, the DMAC 504 receives the next packet.

[0047] When the repeat flag of the next packet is ON, the packet data is not written in the memory, but the preceding entry in the packet table is copied to the address designated by the packet table address register, and the repeat flag of the preceding entry is set ON. No change is added to the packet address register. 4 bytes corresponding to one entry of the packet table are added to the packet table address register. Upon completion of this processing, the DMAC 504 receives the next packet.

[0048] By virtue of employing the above-described method of data transfer from the scanner controller 62 to the system controller 61, the load on the ring bus 600 is reduced.

[0049] The system controller 61 performs various editing processing on the data sent by the scanner controller 62, and outputs the data to the printer controller 63 for printing processing.

[0050] In a case of a digital copying machine, the aforementioned system controller 61, scanner controller 62, and printer controller 63 may be constructed in one semiconductor substrate. However, it is preferable to construct each device in an independent semiconductor substrate so as to be applicable to an improved function of each device.

[0051] In the second embodiment also, a packet table and packet data may be stored as one file.

[0052] Furthermore, the present invention can be applied to a system constituted by a plurality of devices or to an apparatus comprising a single device.

[0053] Further, the object of the present invention can also be achieved by providing a storage medium (or recording medium), storing program codes for a software realizing the functions of the foregoing first and second embodiments, to a computer system or apparatus, reading the program codes, by a computer (CPU or MPU) of the system or apparatus, from the storage medium, then executing the program. In this case, the program codes read from the storage medium realize the functions according to the embodiments, and the storage medium storing the program codes constitutes the present invention.

[0054] Furthermore, besides aforesaid functions according to the above embodiments are realized by executing the program codes which are read by a computer, the present invention includes a case where an OS (operating system) or the like working on the computer performs a part or the entire processes in accordance with designations of the program codes and realizes functions according to the above embodiments.

[0055] Furthermore, the present invention also includes a case where, after the program codes read from the storage medium are written in a function expansion card which is inserted into the computer or in a memory provided in a function expansion unit which is connected to the computer, CPU or the like contained in the function expansion card or unit performs a part or the entire process in accordance with designations of the program codes and realizes functions of the above embodiments.

[0056] As has been set forth above, the foregoing embodiments are effective in a case where packets having the same data continuously exist in image data because the packet data need not be stored in the memory, and thus the amount of memory usage can be reduced. In the case of text data having a white background or the like, it is highly likely that packets continuously have the same data. Therefore, actually a large effect can be expected in reduction of the amount of memory usage.

[0057] Furthermore, according to the second embodiment, comparison of data contents is not performed on a packet having a large volume, but is performed only on a packet having a small volume. This can save the time for comparison, and can reduce the amount of buffer memory necessary for storing a packet subjected to comparison. Furthermore, according to the second embodiment, when a match is found between packet data, data transfer to the DMAC is not performed but only the header is transferred. By virtue of this, the amount of transferring data can be reduced, and actual data transfer speed is improved.

[0058] As described above, the present invention realizes efficient compression of image data, storage and management of the image data.

[0059] The present invention is not limited to the above embodiments and various changes and modifications can be made within the spirit and scope of the present invention. Therefore, to apprise the public of the scope of the present invention, the following claims are made. 

What is claimed is:
 1. An image processing apparatus for compressing and storing image data, comprising: division means for dividing the image data into a pixel block, which is a group of a predetermined number of pixels; generation means for compressing the data in the pixel block unit and sequentially generating packet data; packet table storage means for storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division by said division means; and storage control means for storing packet data of interest generated by said generation means and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest.
 2. The image processing apparatus according to claim 1, wherein the preceding packet data is a packet corresponding to a pixel block immediately preceding to the packet data of interest.
 3. The image processing apparatus according to claim 1, wherein the packet data stored by said storage control means and the packet table are stored as one file.
 4. The image processing apparatus according to claim 1, wherein the packet table includes a flag indicative of whether or not to refer to an address of another packet data as a storage destination of packet data corresponding to a pixel block of interest.
 5. An image processing method of compressing and storing image data, comprising: a division step of dividing the image data into a pixel block, which is a group of a predetermined number of pixels; a generation step of compressing the data in the pixel block unit and sequentially generating packet data; a packet table storage step of storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division at said division step; and a storage control step of storing packet data of interest generated at said generation step and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest.
 6. A computer program functioning as an image processing apparatus which compresses and stores image data, comprising: program codes for a division step of dividing the image data into a pixel block, which is a group of a predetermined number of pixels; program codes for a generation step of compressing the data in the pixel block unit and sequentially generating packet data; program codes for a packet table storage step of storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division at said division step; and program codes for a storage control step of storing packet data of interest generated at said generation step and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest.
 7. A storage medium storing program codes functioning as an image processing apparatus which compresses and stores image data, comprising: program codes for a division step of dividing the image data into a pixel block, which is a group of a predetermined number of pixels; program codes for a generation step of compressing the data in the pixel block unit and sequentially generating packet data; program codes for a packet table storage step of storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division at said division step; and program codes for a storage control step of storing packet data of interest generated at said generation step and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest.
 8. An image processing apparatus at least having compression means for compressing image data, packet generation means for packing the compressed image data in a form of a packet, a buffer for temporarily storing the packet, and comparison means for comparing the packet stored in the buffer with a packet generated by said packet generation means, wherein when said comparison means finds that a compressed packet of interest is equal to compressed packet data stored in said buffer, a flag is set for indicating that data of the compressed packet of interest is equal to data in the buffer.
 9. The image processing apparatus according to claim 8, wherein when a match is found as a result of comparing the packet generated by said packet generation means with packet stored in said buffer, data is extracted from a packet to be generated and a packet including only a packet header is generated.
 10. The image processing apparatus according to claim 8, wherein in a case where a volume of the packet of interest is larger than a predetermined volume, the packet is not stored in said buffer and excluded from comparison.
 11. A memory writing apparatus for receiving the packet described in claim 8, and not storing the packet in a memory when a flag indicative of equality to image data of a preceding pixel block in the packet is set, but storing the packet in the memory when the flag is not set.
 12. A multi-function apparatus having a scanner controller for controlling a scanner unit which reads a document image, a printer controller for controlling a printer unit which prints an image on a print medium, and a system controller for controlling an entire system and having an image memory, all of which are connected through a bus, said scanner controller comprising: division means for dividing image data, read by the scanner unit, into a pixel block, which is a group of a predetermined number of pixels; generation means for compressing the data in the pixel block unit and sequentially generating packet data; packet table storage means for storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division by said division means; storage control means for storing packet data of interest, generated by said generation means, in the image memory and storing a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest; and transfer means for transferring the data, stored by said storage control means, to the system controller through the bus.
 13. A control method of a multi-function apparatus having a scanner controller for controlling a scanner unit which reads a document image, a printer controller for controlling a printer unit which prints an image on a print medium, and a system controller for controlling an entire system, all of which are connected through a bus, said scanner controller comprising: a division step of dividing the image data, read by the scanner unit, into a pixel block, which is a group of a predetermined number of pixels; a generation step of compressing the data in the pixel block unit and sequentially generating packet data; a packet table storage step of storing, as a packet table, a storage address of packet data corresponding to each pixel block subjected to division at said division step; storage control step of storing packet data of interest generated at said generation step and a storage address of the packet data of interest in the packet table when the packet data of interest is different from preceding packet data, whereas when the packet data of interest is equal to the preceding packet data, not storing the packet data of interest, but storing in the packet table a storage address of the preceding packet data as a storage address of the packet data of interest; and a transfer step of transferring the data, stored at said storage control step, to the system controller through the bus. 